/*
 * main implementation: use this 'C' sample to create your own application
 *
 */

#include "Mcu.h"
#include "Port.h"
#include "Dio.h"


extern CONST(Mcu_ConfigType, MCU_CONST) McuModuleConfiguration;

void TestDelay(uint32 delay);
void TestDelay(uint32 delay)
{
   static volatile uint32 DelayTimer = 0;
   while(DelayTimer<delay)
   {
       DelayTimer++;
   }
   DelayTimer=0;
}

/**
* @brief        Main function of the example
* @details      Initializez the used drivers and uses the Icu
*               and Dio drivers to toggle a LED on a push button
*/
int main(void)
{
    /* Initialize the Mcu driver */
    Mcu_Init(&McuModuleConfiguration);

    Mcu_InitClock(McuClockSettingConfig_0);
#if (MCU_NO_PLL == STD_OFF)
    while ( MCU_PLL_LOCKED != Mcu_GetPllStatus() )
    {
        /* Busy wait until the System PLL is locked */
    }

    Mcu_DistributePllClock();
#endif
    Mcu_SetMode(McuModeSettingConf_0);
    /* Initialize all pins using the Port driver */
    Port_Init(&PortConfigSet);
//
    while (1)
    {
        /* Get input level of channels */
    	Dio_WriteChannel((Dio_ChannelType)DioConf_DioChannel_Dio_Rgb_Green, (Dio_LevelType)STD_HIGH);
        TestDelay(5000000);

        Dio_WriteChannel((Dio_ChannelType)DioConf_DioChannel_Dio_Rgb_Green, (Dio_LevelType)STD_LOW);
        TestDelay(5000000);
    }
    while(1);
    return (0U);
}

